package cn.jbit.util;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Component
@ConfigurationProperties(prefix = "response")
@PropertySource(value = "classpath:response.properties")
public class RespPropertiesConfig {

        public Map<String,String> codes=new ConcurrentHashMap<>();

        public Map<String,String> getCodes() {
            return codes;
        }

        public void setCodes(Map<String,String> codes) {
            this.codes = codes;
        }

        public  String  getMsg(Integer code){
            return  this.getCodes().get(code);
        }


}
